<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template random_number_generator</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_random/reference.html#doxygen.headers.random__number__generator_8hpp" title="Header &lt;boost/random/random_number_generator.hpp&gt;">
<link rel="prev" href="classboost_1_1random_1_1random__device.html" title="Class random_device">
<link rel="next" href="ranlux_8hpp_1a87f29fa68674b423a9ce05df92c9c20c.html" title="Type definition ranlux3">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1random_1_1random__device.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_random/reference.html#doxygen.headers.random__number__generator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ranlux_8hpp_1a87f29fa68674b423a9ce05df92c9c20c.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.headers.classboost_1_1random_1_1random__number__generator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template random_number_generator</span></h2>
<p>boost::random::random_number_generator</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_random/reference.html#doxygen.headers.random__number__generator_8hpp" title="Header &lt;boost/random/random_number_generator.hpp&gt;">boost/random/random_number_generator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> URNG<span class="special">,</span> <span class="keyword">typename</span> IntType <span class="special">=</span> <span class="keyword">long</span><span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1random_1_1random__number__generator.html" title="Class template random_number_generator">random_number_generator</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">URNG</span>    <a name="doxygen.headers.classboost_1_1random_1_1random__number__generator_1ac650ed5374f74764a38b32aa4a325f6f"></a><span class="identifier">base_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="identifier">IntType</span> <a name="doxygen.headers.classboost_1_1random_1_1random__number__generator_1ac69c8070a52b0c5a39428f0fe7ef3b8f"></a><span class="identifier">argument_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">IntType</span> <a name="doxygen.headers.classboost_1_1random_1_1random__number__generator_1a4ea8f4d36eb389fe2831fee6e14d82df"></a><span class="identifier">result_type</span><span class="special">;</span>  

  <span class="comment">// <a class="link" href="classboost_1_1random_1_1random__number__generator.html#id-1_3_34_5_6_36_1_1_1_6-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1random_1_1random__number__generator.html#doxygen.headers.classboost_1_1random_1_1random__number__generator_1ab5dfb5482830b949dc9ce0371d754747"><span class="identifier">random_number_generator</span></a><span class="special">(</span><span class="identifier">base_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">result_type</span> <a class="link" href="classboost_1_1random_1_1random__number__generator.html#doxygen.headers.classboost_1_1random_1_1random__number__generator_1a6fcb991000ded175d566a0ccb171f7ed"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">argument_type</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.34.5.6.35.3.4"></a><h2>Description</h2>
<p>Instantiations of class template <a class="link" href="classboost_1_1random_1_1random__number__generator.html" title="Class template random_number_generator">random_number_generator</a> model a RandomNumberGenerator (std:25.2.11 [lib.alg.random.shuffle]). On each invocation, it returns a uniformly distributed integer in the range [0..n).</p>
<p>The template parameter IntType shall denote some integer-like value type. </p>
<div class="refsect2">
<a name="id-1.3.34.5.6.35.3.4.4"></a><h3>
<a name="id-1_3_34_5_6_36_1_1_1_6-bb"></a><code class="computeroutput">random_number_generator</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.headers.classboost_1_1random_1_1random__number__generator_1ab5dfb5482830b949dc9ce0371d754747"></a><span class="identifier">random_number_generator</span><span class="special">(</span><span class="identifier">base_type</span> <span class="special">&amp;</span> rng<span class="special">)</span><span class="special">;</span></pre>
<p>Constructs a <a class="link" href="classboost_1_1random_1_1random__number__generator.html" title="Class template random_number_generator">random_number_generator</a> functor with the given  <a class="link" href="../../boost_random/reference.html#boost_random.reference.concepts.uniform_random_number_generator" title="Uniform Random Number Generator">uniform random number generator</a>  as the underlying source of random numbers. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">result_type</span> <a name="doxygen.headers.classboost_1_1random_1_1random__number__generator_1a6fcb991000ded175d566a0ccb171f7ed"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">argument_type</span> n<span class="special">)</span><span class="special">;</span></pre>
<p>Returns a value in the range [0, n) </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2000-2005 Jens Maurer<br>Copyright © 2009, 2010 Steven Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1random_1_1random__device.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_random/reference.html#doxygen.headers.random__number__generator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ranlux_8hpp_1a87f29fa68674b423a9ce05df92c9c20c.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
